<?
require_once '../../resources/security/security.php';
require_once '../../../classes/product.class.php';
$module_id	= 3;
$module_name = 'Quản lý Đặt mua';
checkLogged();
$bg_errorMsg = '';
$bg_table = 'orders';
$id_field = 'ord_id';
$name_field = 'ord_cus_name';
$bg_filepath = '../../../pictures/products/';
$bg_extension = 'jpg,jpe,png,gif,jpeg';
$limit_size = 12000;
$arr_resize = array( "small_" => array("quality" => 100, "width" => 141, "height" => 130),
					 "medium_" => array("quality" => 100, "width" => 289, "height" => 261)
					);
$arr_pro = db_array("SELECT * FROM products");
foreach($arr_pro as $row){
   $arr_pro_name[$row['pro_id']] = $row['pro_name'];
   $arr_pro_code[$row['pro_id']] = $row['pro_code'];
}
function pro_name($str_pro_id){
   $arr_pro_name = db_array("SELECT pro_name FROM products WHERE pro_id IN(".$str_pro_id.")");
   foreach($arr_pro_name as $row){
      $str_pro_name .= $row['pro_name'].'<br/>';
   }
   $str_pro_name = rtrim($str_pro_name,'<br/>,');
   return $str_pro_name;
}
function pro_code($str_pro_id){
   $arr_pro_code= db_array("SELECT pro_code FROM products WHERE pro_id IN(".$str_pro_id.")");
   foreach($arr_pro_code as $row){
      $str_pro_code .= $row['pro_code'].'<br/>';
   }
   $str_pro_code = rtrim($str_pro_code,'<br/>,');
   return $str_pro_code;
}
?>